<template>
  <view class="container">

    <!-- 缴费金额显示 -->
    <view class="amount-section">
      <text class="amount-label">需缴费金额:</text>
      <text class="amount">278.00<span class="currency">元</span></text>
    </view>

    <!-- 维修单 -->
    <view class="repair-list">
      <text class="list-title">维修单</text>
      <view class="repair-details">
        <view class="repair-item" v-for="(item, index) in repairItems" :key="index">
          <text class="repair-name">{{ item.name }}</text>
          <text class="repair-price">{{ item.price }}元</text>
          <text class="repair-quantity">x{{ item.quantity }}</text>
        </view>
      </view>
      <view class="total">
        <text>合计: 278.00元</text>
      </view>
      <view class="submit-time">
        <text>提交时间: 2023-02-15 09:00</text>
      </view>
    </view>

    <!-- 确认缴费按钮 -->
    <button class="pay-btn" @click="goToPay">已确认缴费单，去缴费</button>
  </view>
</template>

<script>
export default {
  data() {
    return {
      repairItems: [
        { name: '上门费', price: 30, quantity: 1 },
        { name: '软管', price: 20, quantity: 2 },
        { name: '涂料', price: 200, quantity: 1 },
        { name: '配件', price: 58, quantity: 6 }
      ]
    };
  },
  methods: {
    goBack() {
      // 返回上一页
      uni.navigateBack();
    },
     goToPay() {
          // 跳转到支付页面
          uni.navigateTo({
            url: '/pages/index/order/pay'
          });
        }
  }
};
</script>

<style scoped>
.container {
  padding: 20px;
  background-color: #fff;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.back-btn, .more-options-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
}

.title {
  font-size: 18px;
  text-align: center;
}

.amount-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 40px;
}

.amount-label {
  font-size: 25px;
  color: #888;
  align-self: flex-start; 
}

.amount {
  font-size: 46px;
  color: #3a57e5;
  
}

.currency {
  font-size: 24px;
}

.repair-list {
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  position: relative;
  top: -80px;
}

.list-title {
  font-size: 16px;
  color: #3a57e5;
  margin-bottom: 10px;
}

.repair-details {
  border-top: 1px solid #ddd;
  margin-top: 10px;
}

.repair-item {
  display: flex;
  justify-content: space-between;
  margin: 10px 0;
}

.total {
  font-size: 16px;
  font-weight: bold;
  text-align: right;
  margin-top: 20px;
}

.submit-time {
  color: #888;
  text-align: right;
  margin-top: 10px;
}

.pay-btn {
  background-color: #3a57e5;
  color: #fff;
  padding: 10px 20px;
  text-align: center;
  border-radius: 25px;
  margin-top: 20px;
  position: relative;
  top: -70px; 
}

.pay-btn:hover {
  background-color: #2a47c5;
}
</style>
